class Cache {
	setCache(key: string, value: any) {
		window.localStorage.setItem(key, JSON.stringify(value))
	}
	getCache(name: string) {
		const value = window.localStorage.getItem(name)
		if (value) {
			return JSON.parse(value)
		}
	}
	removeCache(key: string) {
		window.localStorage.removeItem(key)
	}
	clearCache() {
		window.localStorage.clear()
	}
}

export default new Cache()
